package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    //根据手机号查询用户
    @Select("select * from user where phone=#{phone}")
    User findUserBYPhone(String phone);

    //添加用户信息
    @Insert("insert into user (phone,status) values (#{phone},#{status})")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    Integer save(User user);
    @Select("select * from user where id = #{userId}")
    User findUserById(Long userId);
}
